home *** CD-ROM | disk | FTP | other *** search
/ The Big Day - Work Smarter - Learn How / The Big Day - Work Smarter - Learn How (Microsoft).BIN / Certification / Microsoft Office User Specialist (MOUS) Certify Your Productivit / homepage.js < prev    next >
Text File  |  2000-05-23  |  10KB  |  280 lines

  1.  
  2.  
  3.  
  4. var IsIEPlus = false
  5. if (navigator.userAgent.indexOf("MSIE")    != -1 && 
  6.     navigator.userAgent.indexOf("Windows") != -1 && 
  7.     navigator.appVersion.substring(0,1) > 3)
  8. {
  9.     IsIEPlus = true;
  10. }
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20. var FLAT_STR = "<table width='180'><tr><td width='7' rowspan='20' valign='top'></td><td width='180' valign='top'><img src='/images/spacer.gif' width='150' height='5'><br><img SRC='/images/blue_bullet.gif' border='0' border='0' name='infobut' ALT='MOUS program information' WIDTH='7' HEIGHT='10'><font face='Verdana, Arial, Helvetica' size='1' color='#000000'><b>General Info</b></font><a href='/program/MOUS_whatis.htm'><br><font face='Verdana, Arial, Helvetica' size='1'>What is MOUS?</a><br><a href='/program/examinfo.htm' >Exam Information</a><br><a href='/program/MOUS_press.htm'>Press Room</a><br><a href='/program/MOUS_benefits.htm'>MOUS Benefits</a><br><a href='/newsletter/'>Newsletter</a><br><a href='/events/MOUS_events.htm'>Events</a><p><img SRC='/images/blue_bullet.gif' border='0' name='button' ALT='Prepare for exams' WIDTH='7' HEIGHT='10'><font face='Verdana, Arial, Helvetica' size='1' color='#000000'><b>Prepare for Exams</b></font><br><a HREF='/program/steps/step1.htm'>How to Prepare</a><br><a HREF='/tests/practice.htm'>Exam Demos</a><br><a href='/testing/locator.asp'>Locate Testing Centers</a><br><a href='/courseware/locate.asp'>Locate Study Materials</a><p><img SRC='/images/blue_bullet.gif' border='0' name='prepbut' ALT='Become a MOUS partner' WIDTH='7' HEIGHT='10'><font face='Verdana, Arial, Helvetica' size='1' color='#000000'><b>Partnering</b></font><br><a href='/testing/types.asp'>Testing Centers</a><br><a href='/courseware/icv.htm'>Courseware Providers</a><br><a href='/instructors/'>Instructors</a></ul><p><a href='/tests/sts.htm'><img src='/images/demo.gif' width=26 height=26 border=0 alt='MOUS Practice tests'><b>Practice Tests for MOUS by STS</b> <br><img src='/images/free.gif' align=left border=0 alt='MOUS Practice test Demo'>Download free demos!</a></td><td width=1 height='100%' rowspan=40 valign=top><img src='/images/redpixel.gif' width=1 height=500></td><td width=10 height='100%' rowspan=40 valign=top><img src='/images/spacer.gif' width=10 height=1></td>";
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29. if (IsIEPlus)
  30. {
  31.     var newLineChar = String.fromCharCode(10);
  32.     var char34 = String.fromCharCode(34);
  33.     var FirstCRMsg = true;
  34.     var hpStr;
  35.     var hpLinkCnt = 0;
  36.     var hpLinkWidth = 0;
  37.  
  38.     hpStr =
  39.         "<TABLE BORDER=0 WIDTH=625 CELLPADDING=0 CELLSPACING=0 BGCOLOR='#FFFFFF'>" +
  40.         "<TR>" +
  41.         "<TD WIDTH=7   HEIGHT=100% ROWSPAN=2><IMG SRC='/images/spacer.gif' WIDTH=7 HEIGHT=1></TD>" +
  42.         "<TD WIDTH=180 HEIGHT=10><IMG SRC='/images/spacer.gif' WIDTH=1 HEIGHT=1></TD>" +
  43.         "<TD WIDTH=10  HEIGHT=100% ROWSPAN=2 ALIGN=MIDDLE VALIGN=TOP><IMG SRC='/images/redpixel.gif' WIDTH=1 HEIGHT=80%></TD>" +
  44.         "<TD WIDTH=7   HEIGHT=100% ROWSPAN=2><IMG SRC='/images/spacer.gif' WIDTH=7 HEIGHT=1></TD>" +
  45.         "<TD WIDTH=436 HEIGHT=10><IMG SRC='/images/spacer.gif' WIDTH=1 HEIGHT=1></TD>" +
  46.         "<TD WIDTH=15  HEIGHT=100% ROWSPAN=2><IMG SRC='/images/spacer.gif' WIDTH=7 HEIGHT=1></TD>" +
  47.         "</TR>" +
  48.         "<TR>" +
  49.         "<TD WIDTH=150 VALIGN=TOP><font face='verdana,arial,helvetica' size=1>" +
  50.         "    <!--HOMEPAGE_LINKS--><BR><BR>" +
  51.         "    <!--CATEGORY_LINKS--><BR>" +
  52.         "    <!--TOP_LINKS-->" +
  53.         "    <IMG SRC='/images/spacer.gif' width=10 height=450>" +
  54.         "</TD>"
  55. }
  56.  
  57. function showHomePage(PageIDStr)
  58. {
  59.     buildNavigation(PageIDStr);
  60.     buildHeadline(PageIDStr);
  61.  
  62.     //alert(hpStr);
  63.     document.write(hpStr);
  64. }
  65.  
  66. function setHomePageLinkTitle(TitleStr)
  67. {
  68.     SubStr = "<!--HOMEPAGE_LINKS-->";
  69.     if (hpStr.indexOf(SubStr) >= 0)
  70.     {
  71.         hpLinkWidth = TitleStr.length;
  72.         SrcStr = TitleStr + "<BR>" +
  73.                  "<SELECT NAME='target' onChange='goHomePage(this);'>" +
  74.                  "<!--HOMEPAGE_LINK-->" +
  75.                  "</SELECT>";
  76.         hpStr = hpStr.replace(SubStr, SrcStr);    
  77.     }
  78. }
  79.  
  80. function addHomePageLink(LinkStr, LinkUrl, defaultSelection)
  81. {
  82.     SubStr = "<!--HOMEPAGE_LINK-->";
  83.     if (hpStr.indexOf(SubStr) >= 0)
  84.     {
  85.         hpLinkCnt += 1;
  86.         SrcStr = "<OPTION VALUE='" + hpLinkCnt + "'";
  87.         if (defaultSelection) SrcStr += " SELECTED";
  88.         SrcStr += ">" + LinkStr;
  89.         
  90.         //Make the select box the same width as the link title.
  91.         for (i = LinkStr.length+1; i < hpLinkWidth+2; i++)
  92.             SrcStr += " ";
  93.  
  94.         SrcStr += SubStr;
  95.         hpStr = hpStr.replace(SubStr, SrcStr);
  96.         
  97.         hpStr += "<A ID=ID_HPLink" + hpLinkCnt + " STYLE='display:none' HREF='" + LinkUrl + "'>1</A>";
  98.     }
  99. }
  100.  
  101. function addCategory(CatIDStr, CatStr, defaultShow)
  102. {
  103.     sImg   = defaultShow? "minus.gif" : "plus.gif";
  104.     sStyle = defaultShow? "black"     : "none";
  105.  
  106.     SubStr = "<!--CATEGORY_LINKS-->";
  107.     if (hpStr.indexOf(SubStr) >= 0)
  108.     {
  109.         SrcStr = "<DIV STYLE='cursor:hand;'" +
  110.                  "     ID=C_" + CatIDStr +
  111.                  "     onClick=clickCategory(" + char34 + CatIDStr + char34 + ") NOWRAP>" +
  112.                  "<IMG SRC='/images/" + sImg + "' ALT='*'" +
  113.                  "     ID=I_" + CatIDStr +
  114.                  "     onClick=clickCategory(" + char34 + CatIDStr + char34 + ") ALIGN=middle BORDER=0> " +
  115.                  "<A STYLE='color:black;text-decoration:none;'" +
  116.                  "   HREF='noop' " +
  117.                  "   onfocus=" + char34 + "window.status='';" + char34 + 
  118.                  "   onmouseover=" + char34 + "window.status='';" + char34 + 
  119.                  "   onclick=" + char34 + "window.event.returnValue = false;" + char34 + ">" +
  120.                  "<B>" + CatStr + "</B></A><BR>" +
  121.                  "<DIV STYLE='display:" + sStyle + ";'" +
  122.                  "     ID=T_" + CatIDStr + 
  123.                  "     onClick=" + char34 + "window.event.cancelBubble=true;" + char34 + ">" +
  124.                  "<DIV STYLE='margin-left:12;'><FONT SIZE=1><!--" + CatIDStr + "-->" + "</DIV>" +
  125.                  "</DIV></DIV>" + SubStr;
  126.         hpStr = hpStr.replace(SubStr, SrcStr);    
  127.     }
  128. }
  129.  
  130. function addCategoryLink(CatIDStr, CatStr, LinkUrl)
  131. {
  132.     SubStr  = "<!--" + CatIDStr + "-->";
  133.     if (hpStr.indexOf(SubStr) >= 0)
  134.     {
  135.         SrcStr = "<A HREF='" + LinkUrl + "'>" + CatStr + "</A><BR>" + SubStr;
  136.         hpStr = hpStr.replace(SubStr, SrcStr);    
  137.     }
  138. }
  139.  
  140. function setTopLinkTitle(TitleStr)
  141. {
  142.     SubStr = "<!--TOP_LINKS-->";
  143.     if (hpStr.indexOf(SubStr) >= 0)
  144.     {
  145.         SrcStr = "<B>" + TitleStr + "</B><BR><DIV STYLE='margin-left:12;'><!--TOP_LINK--></DIV>";
  146.         hpStr = hpStr.replace(SubStr, SrcStr);    
  147.     }
  148. }
  149.  
  150. function addTopLink(LinkStr, LinkUrl)
  151. {
  152.     SubStr  = "<!--TOP_LINK-->";
  153.     if (hpStr.indexOf(SubStr) >= 0)
  154.     {
  155.         SrcStr = "<A HREF='" + LinkUrl + "'>" + LinkStr + "</A><BR>" + SubStr;
  156.         hpStr = hpStr.replace(SubStr, SrcStr);    
  157.     }
  158. }
  159.  
  160. function addStandardLink(TextStr, LinkStr, LinkUrl)
  161. {
  162.     SubStr = "<!--STANDARD_LINK-->";
  163.     if (hpStr.indexOf(SubStr) >= 0)
  164.     {
  165.         SrcStr = TextStr;
  166.         if (LinkStr != "")
  167.         {
  168.             x = TextStr.indexOf(LinkStr);
  169.             if (x >= 0)
  170.             {
  171.                 SrcStr = TextStr.substring(0, x);
  172.                 SrcStr += "<A HREF='" + LinkUrl + "'>" + LinkStr + "</A>";
  173.             
  174.                 x += LinkStr.length;
  175.                 SrcStr += TextStr.substring(x);
  176.             }
  177.         }
  178.         SrcStr += "<BR><BR>" + SubStr;
  179.         hpStr = hpStr.replace(SubStr, SrcStr);    
  180.     }
  181. }
  182.  
  183. function addCopyRightMsg(MsgStr, MsgUrl)
  184. {
  185.     SubStr = "<!--COPYRIGHT-->";
  186.     SrcStr = "";
  187.     if (FirstCRMsg)
  188.     {
  189.         SrcStr = "©";
  190.         FirstCRMsg = false;
  191.     }
  192.     if (MsgUrl == "")
  193.         SrcStr += MsgStr;
  194.     else
  195.         SrcStr += "<A HREF='" + MsgUrl + "'>" + MsgStr + "</A>";
  196.     SrcStr += SubStr;
  197.     hpStr = hpStr.replace(SubStr, SrcStr);    
  198. }
  199.  
  200. function setTopStory(HeadlineStr, StoreStr, LinkUrl, Gif, GifAltStr)
  201. {
  202.     SrcStr = "<A HREF='" + LinkUrl + "'><IMG SRC='" + Gif + "' ALIGN=LEFT WIDTH=117 HEIGHT=85 ALT=" + char34 + GifAltStr + char34 + " BORDER=0></A>";
  203.     hpStr = hpStr.replace("<!--TOP_BANNER-->", SrcStr);    
  204.  
  205.     SrcStr = "<A HREF='" + LinkUrl + "'><B>" + HeadlineStr + "</B></A><BR>" + StoreStr;
  206.     hpStr = hpStr.replace("<!--TOP_STORY-->", SrcStr);    
  207. }
  208.  
  209. function setHeadlineTitle(TitleStr)
  210. {
  211.     SubStr = "<!--HEADLINE_TITLE-->";
  212.     if (hpStr.indexOf(SubStr) >= 0)
  213.     {
  214.         SrcStr = "<B>" + TitleStr + "</B><BR><BR>";
  215.         hpStr = hpStr.replace(SubStr, SrcStr);    
  216.     }
  217. }
  218.  
  219. function setHeadline(placementNo, HeadlineStr, LinkUrl)
  220. {
  221.     if (placementNo < 1 || placementNo > 6) return
  222.  
  223.     SubStr = "<!--BULLET_" + placementNo + "-->";
  224.     SrcStr = "<IMG SRC='/images/blue_bullet.gif' ALT='*' WIDTH=7 HEIGHT=10>";
  225.     hpStr = hpStr.replace